﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FreeLancer.HRB.WebApp.Default" Title="<%$ Resources:labels, webAppTitle %>" %>

<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxTimer" TagPrefix="dxt" %>

<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxNewsControl" TagPrefix="dxnc" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dxw" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dxtc" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
  
<%@ Register Src="~/UserControls/NewsBrowser.ascx" TagName="NewsBrowser" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <script language="javascript" type="text/javascript">
    function isDefined(variable)
    {
      return eval('(typeof('+variable+') != "undefined");');
    }
    
    function ciHome_ASPxTimer_Tick(s,e)
    {
      var flag = isDefined("ciHome_ASPxDataView");
      if(flag)
      {
        ciHome_ASPxDataView.PerformCallback("0");
      }
    }
  </script>
  <div>
    <p style="font-weight:bold; margin-bottom:5px;">
      <a class="more-news" style="color:#AF0000" id="anchorCategoryName" runat="server" 
        href="~/Events.aspx"><%=Resources.labels.specialEvents %></a>
    </p>
    <div style="padding:5px; border: solid 1px #BBBBBB; background-color:#F9F9F9;">
      <dxdv:ASPxDataView ID="ASPxDataView" runat="server" RowPerPage="1" ColumnCount="3" 
        Width="610px" ItemSpacing="2px" ItemStyle-Height="120px" ItemStyle-Width="160px" 
          OnCustomCallback="ASPxDataView_OnCustomCallback" 
          ItemStyle-BackColor="White"
          PagerSettings-Position="Bottom"
          ClientInstanceName="ciHome_ASPxDataView">
        <ItemTemplate>
          <div>
            <dxe:ASPxImage ID="ASPxImageEvent" runat="server" Height="120px" Width="160px"
              ImageUrl='<%# "~/Images/EventImages/"+Eval("Path") %>'/>
            <br />
          </div>
        </ItemTemplate>
        <PagerSettings>
          <Summary Text="{0} / {1}"/>
        </PagerSettings>
      </dxdv:ASPxDataView>
      <dxt:ASPxTimer ID="ASPxTimer" runat="server" Interval="10000"
        ClientSideEvents-Tick="function(s,e) { ciHome_ASPxTimer_Tick(s,e); }">
      </dxt:ASPxTimer>
    </div>
  
    <dxtc:ASPxPageControl ID="ASPxPageControl" runat="server" Width="100%" ActiveTabIndex="0">
    <TabPages>
      <dxtc:TabPage Text="<%$ Resources:labels, needings %>" >
        <ContentCollection>
          <dxw:ContentControl runat="server" ID="CCTRL0">
            <uc:NewsBrowser runat="server" ID="NewsBrowserNeedings" 
              DataSourceId="DataSourceNeedings" 
              MoreNewsVisible="true" TextField="PostContent"
              PagerVisible="false" RowPerPage="3"/>
          </dxw:ContentControl>
        </ContentCollection>
      </dxtc:TabPage>
      <dxtc:TabPage Text="<%$ Resources:labels, areas %>">
        <ContentCollection>
          <dxw:ContentControl runat="server" ID="CCTRL1">
            <uc:NewsBrowser runat="server" ID="NewsBrowserActivities" 
              DataSourceId="DataSourceActivities" 
              MoreNewsVisible="true" TextField="Description" 
              PagerVisible="false" RowPerPage="3"/>
          </dxw:ContentControl>
        </ContentCollection>
      </dxtc:TabPage>
      <dxtc:TabPage Text="<%$ Resources:labels, localNews %>">
        <ContentCollection>
          <dxw:ContentControl runat="server" ID="CCTRL2">
            <uc:NewsBrowser runat="server" ID="NewsBrowserNationalNews" 
              DataSourceId="DataSourceNationalNews" 
              MoreNewsVisible="true" TextField="Description" 
              PagerVisible="false" RowPerPage="3"/>
          </dxw:ContentControl>
        </ContentCollection>
      </dxtc:TabPage>
      <dxtc:TabPage Text="<%$ Resources:labels, globalNews %>">
        <ContentCollection>
          <dxw:ContentControl runat="server" ID="CCTRL3">
            <uc:NewsBrowser runat="server" ID="NewsBrowserInternationNews" 
              DataSourceId="DataSourceInternationNews" 
              MoreNewsVisible="true" TextField="Description" 
              PagerVisible="false" RowPerPage="3"/>
          </dxw:ContentControl>
        </ContentCollection>
      </dxtc:TabPage>
    </TabPages>
    <ActiveTabStyle BackColor="White" Font-Bold="True">
    </ActiveTabStyle>
    <TabStyle BackColor="#FFC0C0" ForeColor="Maroon">
    </TabStyle>
    </dxtc:ASPxPageControl>
  </div>
  <asp:SqlDataSource runat="server" ID="DataSourceNeedings"
    SelectCommand="_hrbPosts_GetPostByCategoryIdLanguageIdFE" SelectCommandType="StoredProcedure" 
    ConnectionString="<%$ ConnectionStrings:netTiersConnectionString %>">
  </asp:SqlDataSource>
  <asp:SqlDataSource runat="server" ID="DataSourceActivities"
    SelectCommand="_hrbPosts_GetPostByCategoryIdLanguageIdFE" SelectCommandType="StoredProcedure" 
    ConnectionString="<%$ ConnectionStrings:netTiersConnectionString %>">
  </asp:SqlDataSource>
  <asp:SqlDataSource runat="server" ID="DataSourceNationalNews"
    SelectCommand="_hrbPosts_GetPostByCategoryIdLanguageIdFE" SelectCommandType="StoredProcedure" 
    ConnectionString="<%$ ConnectionStrings:netTiersConnectionString %>">
  </asp:SqlDataSource>
  <asp:SqlDataSource runat="server" ID="DataSourceInternationNews"
    SelectCommand="_hrbPosts_GetPostByCategoryIdLanguageIdFE" SelectCommandType="StoredProcedure" 
    ConnectionString="<%$ ConnectionStrings:netTiersConnectionString %>">
  </asp:SqlDataSource>
</asp:Content>

